package com.edu.jvm.unit01.Dynamic.assign;

/**
 * 查看普通类是否具有分派情况（也存在）
 *
 * @author five-five
 * @created 2021/10/10-9:22
 */
public class NormalDispatch {
    public static void main(String[] args) {
        Person tea = new Teacher();
        Person stu = new Student();
        NormalDispatch normalDispatch = new NormalDispatch();
        normalDispatch.saySth(tea);
        normalDispatch.saySth(stu);

    }


    public void saySth(Person person) {
        System.out.println("person");
    }

    public void saySth(Student person) {
        System.out.println("student");
    }

    public void saySth(Teacher person) {
        System.out.println("teacher");
    }

}
